package com.example.pet.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.pet.dao.CollectDao;
import com.example.pet.entity.Collect;
import com.example.pet.service.CollectService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * �ղ�(Collect)表服务实现类
 *
 * @author makejava
 * @since 2023-05-13 12:36:24
 */
@Service
public class CollectServiceImpl implements CollectService {
    @Resource
    private CollectDao collectDao;
    @Override
    public List<Collect> getAll(Integer id) {
        QueryWrapper<Collect> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("post_id",id);
        return collectDao.selectList(queryWrapper);
    }
    @Override
    public List<Collect> get(Integer id) {
        QueryWrapper<Collect> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id",id);
        return collectDao.selectList(queryWrapper);
    }
}

